package com.ruoyi.web.admin.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import  com.ruoyi.web.admin.mapper.TdmCmcMapper;
import  com.ruoyi.web.admin.domain.TdmCmc;
import  com.ruoyi.web.admin.service.ITdmCmcService;

/**
 * CMCService业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-10
 */
@Service
public class TdmCmcServiceImpl implements ITdmCmcService 
{
    @Autowired
    private TdmCmcMapper tdmCmcMapper;

    /**
     * 查询CMC
     * 
     * @param id CMC主键
     * @return CMC
     */
    @Override
    public TdmCmc selectTdmCmcById(Long id)
    {
        return tdmCmcMapper.selectTdmCmcById(id);
    }

    /**
     * 查询CMC列表
     * 
     * @param tdmCmc CMC
     * @return CMC
     */
    @Override
    public List<TdmCmc> selectTdmCmcList(TdmCmc tdmCmc)
    {
        return tdmCmcMapper.selectTdmCmcList(tdmCmc);
    }

    /**
     * 新增CMC
     * 
     * @param tdmCmc CMC
     * @return 结果
     */
    @Override
    public int insertTdmCmc(TdmCmc tdmCmc)
    {
        tdmCmc.setCreateTime(DateUtils.getNowDate());
        return tdmCmcMapper.insertTdmCmc(tdmCmc);
    }

    /**
     * 修改CMC
     * 
     * @param tdmCmc CMC
     * @return 结果
     */
    @Override
    public int updateTdmCmc(TdmCmc tdmCmc)
    {
        tdmCmc.setUpdateTime(DateUtils.getNowDate());
        return tdmCmcMapper.updateTdmCmc(tdmCmc);
    }

    /**
     * 批量删除CMC
     * 
     * @param ids 需要删除的CMC主键
     * @return 结果
     */
    @Override
    public int deleteTdmCmcByIds(Long[] ids)
    {
        return tdmCmcMapper.deleteTdmCmcByIds(ids);
    }

    /**
     * 删除CMC信息
     * 
     * @param id CMC主键
     * @return 结果
     */
    @Override
    public int deleteTdmCmcById(Long id)
    {
        return tdmCmcMapper.deleteTdmCmcById(id);
    }
}
